from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import time
from selenium.webdriver import ActionChains # 动作链

driver_path = Service(executable_path='./chromedriver.exe')
options = Options()
options.add_experimental_option("detach",True)
browser = webdriver.Chrome(service=driver_path, options=options)


browser.get('https://www.runoob.com/try/try.php?filename=jqueryui-api-droppable')
iframe = browser.find_element(By.ID,'iframeResult')
browser.switch_to.frame(iframe)
s = browser.find_element(By.ID,'draggable')
d = browser.find_element(By.ID,'droppable')
actions = ActionChains(browser)
actions.drag_and_drop(s,d)

actions.perform()